package com.lvyq.myplayer.widget.common.song

import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.RelativeLayout
import android.widget.TextView
import com.lvyq.myplayer.R
import com.lvyq.myplayer.parcelable.SongInfoData

/**
 * 文件描述：SongItemCheckBoxView 批量复选操作视图
 * 作者：lvyq
 * 创建时间：2025-06-20
 * 修改时间：2025-06-20
 */
class SongItemCheckBoxView: RelativeLayout {
    lateinit var title :TextView
    lateinit var singer :TextView

    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    init {
        var view = View.inflate(context, R.layout.item_song_checkbox, this)
        title= view.findViewById<TextView>(R.id.title)
        singer=view.findViewById<TextView>(R.id.singer)
        initListener()
    }


    private fun initListener() {
        //单击事件在Adapter中实现。方便Activity回调处理
    }

    fun setData(data: SongInfoData) {
        title.setText(data.title)
        singer.setText(data.singer)
    }


}